<?php if(isset($_SESSION['user']['user_id']) && $_SESSION['user']['user_id']!=""){?>
<div class="col-md-8">
<div class="main-content" id="main-content">
	<div class="sub-content">
			<div class="top-header page-header clearfix">
				<h1>User Profile</h1>
			</div>
			<div class="top-links btn-active3">
				<ul class="form-progress-bar">					
					<li class="active-menu step-no"><a href="<? echo $this->Url('profiles')?>/userprofile"><span>1</span></a></li>
					<li class="indicator active-menu"><span></span></li>
					<li class="step-no active-menu"><a  href="<? echo $this->Url('profiles')?>/userprofile_next"><span>2</span></a></li>
					<li class="indicator active-menu"><span></span></li>
					<li class="active-menu step-no"><a  href="<? echo $this->Url('profiles')?>/userprofile_confirm"><span>3</span></a></li>									
				</ul>
			</div>
		<div class="user-profile1 col-md-12">
				<form id="signupForm" name="signupForm"  method="post" class="form-horizontal" role="form">
					
						<div class="form-group">
							<label class="control-label col-sm-3">Company Name</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->company_name) ){?>
								<input  type="text" id="cname" name="cname" class="form-control" readonly="readonly" value="<? echo $this->user_details->company_name;?>" placeholder="Company Name"> 
							<?}?>
						</div></div>
						<div class="form-group">
							<label class="control-label col-sm-3">Industry</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->industryname) ){?>
								<input  type="text" id="industry" class="form-control" value="<? echo $this->user_details->industryname;?>" name="industry" readonly="readonly" placeholder="Please enter country"/>
							<?}?>
						</div></div>
						<div class="form-group">
							<label class="control-label col-sm-3">Address 1</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->address1) ){?>
								<textarea  class="profile_add form-control" id="address1" readonly="readonly" name="address1" ><? echo $this->user_details->address1;?></textarea>
							<?}?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Address 2</label>	
<div class="col-sm-9">							
							<?if( isset($this->user_details->address2) ){?>
								<textarea class="profile_add form-control" id="address2" name="address2"   readonly="readonly" ><? echo $this->user_details->address2;?></textarea>
							<?}?></div>
						</div>
						<div class="form-group ">
							<label class="control-label col-sm-3">Address 3</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->address3) ){?>
								<textarea  class="profile_add form-control" id="address3" name="address3"  readonly="readonly" ><? echo $this->user_details->address3;?></textarea>
							<?}?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Landmark Near By</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->landmarknearby) ){?>
								<input type="text" id="lmnear" name="lmnear" class="form-control"  readonly="readonly"  value="<? echo $this->user_details->landmarknearby;?>" placeholder="Landmark Near By" />
							<?}?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">City</label>							
							<div class="col-sm-9">
							<?if( isset($this->user_details->city) ){?>
								<input  type="text" id="city"  readonly="readonly" class="form-control" value="<? echo $this->user_details->city;?>" name="city" placeholder="Please enter city"/>
							<?}?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Country</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->usercountry) ){?>
								<input  type="text" id="country" class="form-control"  value="<? echo $this->user_details->usercountry;?>" name="country" readonly="readonly" placeholder="Please enter country"/>
							<?}?></div>
						</div>
						<div class="form-group" id="currCFormsList1">
							<label class="control-label col-sm-3">Regions</label>
							<div id="regions" class="col-sm-9">
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Email</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->email) ){?>
								<input  type="text" id="email" name="email" class="form-control" readonly="readonly" value="<? echo $this->user_details->email;?>" placeholder="Email" />
							<?}?></div>
						</div> 
						<div class="form-group">
							<label class="control-label col-sm-3">Phone </label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->phone) ){?>
								<input  type="text" id="phone" name="phone" class="form-control" readonly="readonly" value="<? echo $this->user_details->phone;?>" placeholder="Phone" />
							<?}?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Fax </label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->fax) ){?>
								<input  type="text" id="fax" name="fax"  class="form-control" readonly="readonly" placeholder="Fax" value="<? echo $this->user_details->fax;?>" />
							<?}?></div>
						</div>
						
					<div class="form-group">
						<label class="control-label col-sm-3">Contact Person 1</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->contact_person) ){?>
								<input  type="text" id="cperson" name="cperson" class="form-control" readonly="readonly"  value="<? echo $this->user_details->contact_person;?>" placeholder="Contact Person 1"> 
							<?}?></div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-3">Mobile No</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->mobile) ){?>
								<input  type="text" id="mobile" name="mobile" class="form-control" readonly="readonly"  value="<? echo $this->user_details->mobile;?>" placeholder="Mobile No">
							<?}?></div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-3">Email Address</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->second_email) ){?>
								<input  type="text" id="email" name="email" class="form-control" readonly="readonly"  value="<? echo $this->user_details->second_email;?>" placeholder="Email"> 
							<?}?></div>
					</div>
				    <div class="form-group">
						<label class="control-label col-sm-3">Bank Address</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->bankaddress) ){?>
								<input  type="text" id="baddress" name="baddress" class="form-control" readonly="readonly"  value="<? echo $this->user_details->bankaddress;?>" placeholder="Bank Address"> 
							<?}?>
					</div></div>
					<div class="form-group">
						<label class="control-label col-sm-3">Account No</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->account_number) ){?>
								<input  type="text" id="acno" name="acno" class="form-control" readonly="readonly"  value="<? echo $this->user_details->account_number;?>" placeholder="Account No"> 
							<?}?></div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-3">Note</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->note) ){?>
								<input  type="text" id="note" name="note" class="form-control" readonly="readonly"  value="<? echo $this->user_details->note;?>" placeholder="Note">
							<?}?></div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-3">User Type</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->user_type) ){?>
								<input  type="text" id="type" name="type" class="form-control" readonly="readonly"  value="<? echo $this->user_details->user_type;?>" placeholder="User Type">
							<?}?></div>
					</div>
					<div class="form-group">
								<label class="control-label col-sm-3">Status</label>
							<div class="col-sm-9">
							<?if( isset($this->user_details->u_status) ){
							if( $this->user_details->u_status == '0' ){
								$statusMsg = "Pending";
							}
							else if( $this->user_details->u_status == '1' ){
								$statusMsg = "Activate";
							}
							else if( $this->user_details->u_status == '2' ){
									$statusMsg = "DeActive";
								}?>
									<input  type="text" id="status" class="form-control" name="status" readonly="readonly"  value="<? echo $statusMsg;?>" placeholder="status">
							<?}?>
								</div>
					</div>
						<input type="hidden" id="indsCntrysIds" name="indsCntrysIds" value="<? if(isset($_SESSION['usersinfo']['regionsInfo'])){ echo $_SESSION['usersinfo']['regionsInfo']; } else{ echo "";} ?><? if(isset( $this->loadedRegions )){ echo $this->loadedRegions; } else{ echo "";} ?>" />
						<input type="hidden" id="indsCntrysCount" name="indsCntrysCount" value="<? if(isset($_SESSION['usersinfo']['indsCntrysCount'])){ echo $_SESSION['usersinfo']['indsCntrysCount']; } else{ echo "";} ?><? if(isset( $this->existingRegionsCount )){ echo $this->existingRegionsCount; } else{ echo "";} ?>" />
						<input type="hidden" id="hid_user_id" name="hid_user_id" value=""/>					
						<input type="hidden" id="edit_status" name="edit_status" value="">
						<div class="form-group">
							<label class="col-sm-3">&nbsp;</label>
							<div class="col-sm-9">
								
								   <a href="javascript:void(0)" class="btn btn-danger" role="button" id="register" onclick="validate();" >Submit</a>							 
									<div id="loading" style="display:none;float:right;margin-right:30px;"><img src="" /></div>
								
							</div>
						</div>
					
				</form>
		</div>
	</div>
</div></div>
<script type="text/javascript">

$( document ).ready(function()
{

	var indsCntrysCount = $("#indsCntrysCount").val().trim();
	var indsCntrysIds = $("#indsCntrysIds").val();
	
	// alert( indsCntrysCount );
	// alert( indsCntrysIds );
	
	var regionsDivHtml = "";

	var regionsInfoRows = indsCntrysIds.split( "!" );

	for( var regionRowId = 0; regionRowId < indsCntrysCount; regionRowId++ )
	{
		var regionRow = regionsInfoRows[regionRowId].split( "-" );
		
		regionsDivHtml += regionRow[1] + ",";
	}
	regionsDivHtml = regionsDivHtml.substring(0, (regionsDivHtml.length-1));
	
	$("#regions").html( regionsDivHtml );

});



	function validate(){
		$("#signupForm").attr( "action", "userprofile" );	
		$("#signupForm").submit();
	}
</script>
<?php }else{?>
<script>
	window.location='<? echo $this->Url('home')?>';
</script>
<?php }?>

	

        